feat: Implement GitHub Authentication with Better Auth #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Implement GitHub Authentication with Better Auth
Summary
Implements GitHub OAuth authentication using Better Auth as requested in issue #1.
Changes Made
Files Created:
lib/auth.ts- Server-side Better Auth configuration with GitHub providerapp/api/auth/[...all]/route.ts- Next.js API route handler for OAuth flowGITHUB_AUTH_README.md- Complete setup and testing documentation.env.example- Environment variables templateFiles Modified:
lib/auth-client.ts- Added exported sign-in methods for easier accesscomponents/login/sign-in.tsx- Wired GitHub button with OAuth handler, added loading statesImplementation Details
Setup Required
{YOUR_URL}/api/auth/callback/github.env.example):GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETNEXT_PUBLIC_APP_URLAUTH_SECRETTesting
To test locally:
Navigate to
/authand click "Sign in with Github"Notes
About This Contribution
I've implemented this feature to demonstrate my capabilities and familiarity with your codebase. I'm also interested in working on issues #5, #6, and #7.
Happy to discuss compensation structure if you're interested in having me continue contributing to Boundless!
Resolves
Closes #1
Ready for review! Let me know if you'd like any adjustments.